//
//  HDUkeInfoCenter.m
//  HDVideoKit
//
//  Created by ^-^ on 2020/9/14.
//  Copyright © 2020 LiuGaoSheng. All rights reserved.
//

#import "HDUkeInfoCenter.h"
#import <SVProgressHUD/SVProgressHUD.h>

@interface HDUkeInfoCenter ()

@end

@implementation HDUkeInfoCenter
+ (instancetype)sharedCenter {
    return [[self alloc] init];
}

- (instancetype)init {
    if (self = [super init]) {
        [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeClear];
        [SVProgressHUD setDefaultStyle:SVProgressHUDStyleDark];
    }
    return self;
}
+ (instancetype)allocWithZone:(struct _NSZone *)zone {
    static HDUkeInfoCenter *singleClass = nil;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        singleClass = [super allocWithZone:zone];//最先执行，只执行了一次
    });
    return singleClass;
}

- (NSString *)token {
    if (_token == nil || [_token isEqualToString:@""]) {
        return [[NSUserDefaults standardUserDefaults] objectForKey:@"JF_Public_UserToken"];;
    }else{
        return _token;
    }
}
- (NSString *)uuid {
    if (_uuid == nil || [_uuid isEqualToString:@""]) {
        return [[NSUserDefaults standardUserDefaults] objectForKey:@"JF_Public_UserUuid"];
    }else{
        return _uuid;
    }
}

- (HDNetEnvironmentType)HTTPType {
    if (!_HTTPType) {
        return [[NSUserDefaults standardUserDefaults] integerForKey:@"JF_Public_HTTPType"];
    }else{
        return _HTTPType;
    }
    
}

- (NSString *)HTTPURL {
    if (_HTTPType == HDNetEnvironmentType_Test) {
        return @"http://sy.smartlink-tech.com.cn:81/dspfawapi/mobile";//新测试地址
    }
    else if (_HTTPType == HDNetEnvironmentType_Uat) {

        return @"https://uat-iov-ec.fawjiefang.com.cn/fawdspapi/mobile";//新测试地址
        
    }
    else if (_HTTPType == HDNetEnvironmentType_Releases) {
        
        return @"https://jfvideo.fawjiefang.com.cn/fawdspapi/mobile";//正式环境地址
        
    }
     return @"https://jfvideo.fawjiefang.com.cn/fawdspapi/mobile";//正式环境地址;
}

- (NSString *)shareURL {
    if (_HTTPType == HDNetEnvironmentType_Test) {
        return @"http://sy.smartlink.com.cn:81/drvdspfawshare/index.html?";
        
    }
    else if (_HTTPType == HDNetEnvironmentType_Uat) {
        return @"https://uat-iov-ec.fawjiefang.com.cn/fawdspshare/index.html?";
        

    }
    else if (_HTTPType == HDNetEnvironmentType_Releases) {
        
        return @"https://jfvideo.fawjiefang.com.cn/fawdspshare/index.html?";
        
    }
    return @"https://jfvideo.fawjiefang.com.cn/fawdspshare/index.html?";//正式地址
}

- (NSString *)jfHttpURL {
    if (_HTTPType == HDNetEnvironmentType_Test) {
        return @"https://sy.smartlink.com.cn:44300/test/faw/drv/api";
        
    }
    else if (_HTTPType == HDNetEnvironmentType_Uat) {
        return @"https://uat-iov-ec.fawjiefang.com.cn/faw/drv/api";
        

    }
    else if (_HTTPType == HDNetEnvironmentType_Releases) {
        
        return @"https://iov-ec.fawjiefang.com.cn/faw/drv/api";
        
    }
    return @"https://iov-ec.fawjiefang.com.cn/faw/drv/api";//正式环境地址
}

@end


@implementation HDUkeInfoCenterModel
+ (NSDictionary *)mj_replacedKeyFromPropertyName {
    return @{@"uuid":@"id"};
}

//- (NSString *)token {
//    return [[NSUserDefaults standardUserDefaults] objectForKey:@"JF_Public_UserToken"];
//}

@end


@implementation HDUserCenterProfileModel



@end


@implementation HDUkeConfigurationModel


@end
